package com.bright.cwduijie.common.event.thread;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author Tz
 * @date 2024/01/22 15:03
 * @Description 动态线程池的变更事件发布类
 */
@Service
public class DynamicThreadPoolChangePublisher {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    /**
     * PostConstruct: 初始化执行发布
     */
    @PostConstruct
    public void init() {
        applicationEventPublisher.publishEvent(new DynamicThreadPoolChangeEvent(this));
    }
}
